Page({
  data: {
    banners: [
      { id: 1, image: '/static/edu-banner1.jpg' },
      { id: 2, image: '/static/edu-banner2.jpg' },
      { id: 3, image: '/static/edu-banner3.jpg' }
    ],
    categories: [
      { id: 1, name: '编程开发', icon: '/static/edu-cate1.png' },
      { id: 2, name: '设计创意', icon: '/static/edu-cate2.png' },
      { id: 3, name: '语言学习', icon: '/static/edu-cate3.png' },
      { id: 4, name: '考试认证', icon: '/static/edu-cate4.png' },
      { id: 5, name: '职场技能', icon: '/static/edu-cate5.png' },
      { id: 6, name: '兴趣爱好', icon: '/static/edu-cate6.png' },
      { id: 7, name: 'K12教育', icon: '/static/edu-cate7.png' },
      { id: 8, name: '大学课程', icon: '/static/edu-cate8.png' }
    ],
    hotCourses: [
      { 
        id: 1, 
        name: 'Java编程入门', 
        teacher: '张老师', 
        price: '¥199', 
        cover: '/static/course1.jpg' 
      },
      { 
        id: 2, 
        name: 'UI设计基础', 
        teacher: '李老师', 
        price: '¥299', 
        cover: '/static/course2.jpg' 
      },
      { 
        id: 3, 
        name: 'Python数据分析', 
        teacher: '王老师', 
        price: '¥399', 
        cover: '/static/course3.jpg' 
      }
    ],
    recommendCourses: [
      { 
        id: 4, 
        name: 'Web前端开发', 
        desc: '从零开始学习HTML、CSS和JavaScript', 
        students: 1250, 
        price: '¥299', 
        cover: '/static/course4.jpg' 
      },
      { 
        id: 5, 
        name: 'Photoshop进阶', 
        desc: '掌握高级修图技巧和设计方法', 
        students: 980, 
        price: '¥199', 
        cover: '/static/course5.jpg' 
      },
      { 
        id: 6, 
        name: '英语口语提升', 
        desc: '30天快速提升英语交流能力', 
        students: 1560, 
        price: '¥399', 
        cover: '/static/course6.jpg' 
      }
    ]
  },

  onLoad() {
    // 这里可以添加从服务器获取数据的逻辑
  },

  navigateToCategory(e) {
    const id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: `/pages/education/category/category?id=${id}`
    });
  },

  navigateToCourseList() {
    wx.navigateTo({
      url: '/pages/education/list/list'
    });
  },

  navigateToDetail(e) {
    const id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: `/pages/education/detail/detail?id=${id}`
    });
  }
});
